#ifndef FUNCTION_PTR
#define FUNCTION_PTR

#include<string>
#include"Functions.h"

struct FunctionPtr {
    FunctionPtr();
    explicit FunctionPtr(std::string const & function);
    ~FunctionPtr();
    FunctionPtr(FunctionPtr const & copy);
    Function & operator=(FunctionPtr const & right);
    void operator=(std::string const & right);
    Function * operator->() const;
    Function & operator*() const;
    bool operator==(FunctionPtr const & right) const;
    bool operator!=(FunctionPtr const & rigth) const;
    void swap(FunctionPtr & right);
private:
    Function * ptr_;
    int * copy_counter_;
    Function * createObject(std::string const & function) const;
};

#endif